package cn.flant.db.hdle.dialect;

public class MysqlDialect extends AnsiDialect {
	@Override
	public String buildPageSql(String selectSql, int pageSize, int pageNo) {
		int from = pageSize * (pageNo - 1);
		StringBuilder sb = new StringBuilder();
		sb.append("SELECT T.* FROM (").append(selectSql).append(") T LIMIT ").append(from).append(",").append(pageSize);
		return sb.toString();
	}

	@Override
	public boolean isSupportAutoGenerateKey() {
		return true;
	}
}
